using System;
using System.Collections.Generic;
using System.ByteBuffer;
using tools;

namespace Login
{
    /// <summary>
    /// generate by msg tool
    /// 登陆
    /// </summary>
	public class ReqLoginMsg : ReqMessage
	{
		//微信openId
		public String openId;
		//微信昵称
		public String nickName;
		//性别
		public int sex;
		//头像地址
		public String icon;
		//国家
		public String country;
		//省
		public String province;
		//市
		public String city;
		//机器码
		public String mac;

        public ReqLoginMsg() { }

        public ReqLoginMsg(String openId, String nickName, int sex, String icon, String country, String province, String city, String mac)
        {
            this.openId = openId;
            this.nickName = nickName;
            this.sex = sex;
            this.icon = icon;
            this.country = country;
            this.province = province;
            this.city = city;
            this.mac = mac;
        }

        
		public void write(object obj)
		{
            ByteBuffer b = obj as ByteBuffer;
			b.PushString(openId);
			b.PushString(nickName);
			b.PushInt(sex);
			b.PushString(icon);
			b.PushString(country);
			b.PushString(province);
			b.PushString(city);
			b.PushString(mac);
			
		}

	    public void read(object obj)
		{
            MyConverter b = obj as MyConverter;
			openId = b.toString();
			nickName = b.toString();
			sex = b.toInt32();
			icon = b.toString();
			country = b.toString();
			province = b.toString();
			city = b.toString();
			mac = b.toString();
			
		}

		public int Id
		{
            get { return 100101; }
		}

        public String Desc
        {
            get { return "登陆"; }
        }
	}
}